package tech.powerjob.samples.processors;

import lombok.extern.slf4j.Slf4j;
import tech.powerjob.worker.core.processor.ProcessResult;
import tech.powerjob.worker.core.processor.TaskContext;
import tech.powerjob.worker.core.processor.sdk.BasicProcessor;

import java.util.Optional;

/**
 * @author Echo009
 * @since 2022/4/27
 */
@Slf4j
public class SimpleProcessor implements BasicProcessor {

    @Override
    public ProcessResult process(TaskContext context) throws Exception {

        String jobParams = Optional.ofNullable(context.getJobParams()).orElse("S");

        log.info(" ================================ 任务开始执行 :{}", jobParams);

        return new ProcessResult(true,"任务成功啦！！！");

    }
}